#!/bin/bash
echo "=== Testing Multi-line Input Support ==="
echo ""

echo "Testing multi-line factorial definition:"
cat << 'EOF' | ./ascheme
(define (factorial n)
  (if (= n 0)
      1
      (* n (factorial (- n 1)))))
(factorial 6)
exit
EOF

echo ""
echo "Testing multi-line let expression:"
cat << 'EOF' | ./ascheme
(let ((x 10)
      (y 20)
      (z 30))
  (+ x y z))
exit
EOF

echo ""
echo "Testing multi-line cond expression:"
cat << 'EOF' | ./ascheme
(define (classify-number n)
  (cond 
    ((< n 0) 'negative)
    ((= n 0) 'zero)
    ((< n 10) 'single-digit)
    (else 'multi-digit)))
(classify-number 5)
(classify-number -3)
(classify-number 15)
exit
EOF

echo ""
echo "All multi-line tests completed!"